package com.example.app13_sqlite.dao;

import android.util.Log;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

import com.example.app13_sqlite.entity.BlackNumber;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.List;

@RunWith(AndroidJUnit4.class)
public class BlackNumberDaoTest {

    private static final String TAG = "BlackNumberDaoTest";

    private BlackNumberDao blackNumberDao;

    @Before
    public void setUp() {
        blackNumberDao = new BlackNumberDao(InstrumentationRegistry.getInstrumentation().getContext());
    }

    @Test
    public void testAdd() {
        blackNumberDao.add(new BlackNumber("黑名单测试"));
    }

    public void testGetAll() {
        List<BlackNumber> blackNumberList = blackNumberDao.getAll();
        Log.i(TAG, "testGetAll: " + blackNumberList);
    }
}
